package com.smartcar.common.utils.IpAaddress;

import cn.hutool.http.HttpUtil;
import lombok.extern.log4j.Log4j2;

import java.net.InetAddress;

@Log4j2
public class IpAddress {
    public static String ipAddress() throws Exception{
        String address = InetAddress.getLocalHost().getHostAddress();
        String body = HttpUtil.createGet("https://restapi.amap.com/v3/ip?ip=" + address +"&output=xml&key=b0fdafde299ea0975161d43db6b6bacc").execute().body();
        log.info(body);
        return body;
    }
}
